package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HaDepartmentMapper;
import com.ruoyi.system.domain.HaDepartment;
import com.ruoyi.system.service.IHaDepartmentService;

/**
 * 科室管理Service业务层处理
 * 
 * @author 鲍小伟
 * @date 2025-11-10
 */
@Service
public class HaDepartmentServiceImpl implements IHaDepartmentService 
{
    @Autowired
    private HaDepartmentMapper haDepartmentMapper;

    /**
     * 查询科室管理
     * 
     * @param kid 科室管理主键
     * @return 科室管理
     */
    @Override
    public HaDepartment selectHaDepartmentByKid(Long kid)
    {
        return haDepartmentMapper.selectHaDepartmentByKid(kid);
    }

    /**
     * 查询科室管理列表
     * 
     * @param haDepartment 科室管理
     * @return 科室管理
     */
    @Override
    public List<HaDepartment> selectHaDepartmentList(HaDepartment haDepartment)
    {
        return haDepartmentMapper.selectHaDepartmentList(haDepartment);
    }

    /**
     * 新增科室管理
     * 
     * @param haDepartment 科室管理
     * @return 结果
     */
    @Override
    public int insertHaDepartment(HaDepartment haDepartment)
    {
        haDepartment.setCreateTime(DateUtils.getNowDate());
        return haDepartmentMapper.insertHaDepartment(haDepartment);
    }

    /**
     * 修改科室管理
     * 
     * @param haDepartment 科室管理
     * @return 结果
     */
    @Override
    public int updateHaDepartment(HaDepartment haDepartment)
    {
        haDepartment.setUpdateTime(DateUtils.getNowDate());
        return haDepartmentMapper.updateHaDepartment(haDepartment);
    }

    /**
     * 批量删除科室管理
     * 
     * @param kids 需要删除的科室管理主键
     * @return 结果
     */
    @Override
    public int deleteHaDepartmentByKids(Long[] kids)
    {
        return haDepartmentMapper.deleteHaDepartmentByKids(kids);
    }

    /**
     * 删除科室管理信息
     * 
     * @param kid 科室管理主键
     * @return 结果
     */
    @Override
    public int deleteHaDepartmentByKid(Long kid)
    {
        return haDepartmentMapper.deleteHaDepartmentByKid(kid);
    }
}
